﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2008A.PH5._0221_0317.FuXi.IService
{
    public interface IBaseService<T> where T : class,new()
    {
        IQueryable<T> Query();
        IQueryable<T> Query(int pageIndex,int pageSize,out int total);
        int Insert(T t);


        //表达式查询
        IQueryable<T> Query(System.Linq.Expressions.Expression<Func<T, bool>> where);

        //表达式查询带分页
        IQueryable<T> Query(System.Linq.Expressions.Expression<Func<T,bool>> where,int pageIndex,int pageSize,out int total);

        //表达式查询、排序带分页
        IQueryable<T> Query<TKey>(System.Linq.Expressions.Expression<Func<T,bool>> where,
            System.Linq.Expressions.Expression<Func<T,TKey>> sort,bool isAsc,  int pageIndex, int pageSize, out int total);

    }
}
